package test;


//import org.apache.hadoop.conf.Configuration;
//import org.apache.hadoop.hbase.*;
//import org.apache.hadoop.hbase.client.Admin;
//import org.apache.hadoop.hbase.client.Connection;
//import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.junit.Test;

import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class Main {
//    @Test
//    public void test(){
//
//        try {
//            String createTableName = "mytable2";
//            Configuration configuration = HBaseConfiguration.create();;
//            configuration.set("hbase.zookeeper.quorum", "118.89.27.73");
////           configuration.set("hbase.master", "118.89.27.73");
//            Connection connection = ConnectionFactory.createConnection(configuration);
//            Admin hBaseAdmin = connection.getAdmin();
//            HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf("hbasestudy"));
//            tableDescriptor.addFamily(new HColumnDescriptor("column1"));
//            tableDescriptor.addFamily(new HColumnDescriptor("column2"));
//            tableDescriptor.addFamily(new HColumnDescriptor("column3"));
//            hBaseAdmin.createTable(tableDescriptor);
//            hBaseAdmin.close();
//        } catch (MasterNotRunningException e) {
//            e.printStackTrace();
//        } catch (ZooKeeperConnectionException e) {
//            e.printStackTrace();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        System.out.println("end create table ......");
//    }

    public static void main(String args[]) {
        int a = 1;
        Integer b = 127;
        Integer c = 127;
        System.out.println(c == b);
        SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
        Date date = new Date();
        System.out.println(bartDateFormat.format(date));
        Calendar calendar = Calendar.getInstance();
        System.out.println(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
        date = calendar.getTime();
        System.out.println(bartDateFormat.format(date));
        A t = new B();
        System.out.println(t.a);
        test(new Main());
       System.out.println(Main.class);
    }

    public static <E> void test(E e) {
     System.out.println(e.getClass());
    }

}

class OuterClass {

    int c = 10;

    class InnerClass {
        int a = 10;
        int c = 30;

        public void a() {
            System.out.println(OuterClass.this.c);
        }
    }

    static class StaticNestedClass {
        int b = 10;
        static int a = 10;
    }
}

class A {
    private int b = 1;
    int a = 5;

    public static void Test() {
        System.out.println("super");
    }
}

class B extends A {
    int a = 1;
}

